﻿using System;

namespace SimpleFactory
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                // 通过工厂创建不同聚类算法实例
                IClustering kmeans = ClusteringFactory.CreateClustering("kmeans");
                IClustering dbscan = ClusteringFactory.CreateClustering("dbscan");
                IClustering hierarchical = ClusteringFactory.CreateClustering("hierarchical");

                // 调用聚类方法
                kmeans.Cluster();
                dbscan.Cluster();
                hierarchical.Cluster();
            }
            catch (Exception ex)
            {
                Console.WriteLine("错误：" + ex.Message);
            }

            Console.ReadKey();
        }
    }
}